package com.example.testproject.view_model

import android.util.Log
import android.view.View
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 *
 * @ClassName: LandViewModel
 * @Author: android 超级兵
 * @CreateDate: 11/2/21$ 10:02 AM$
 * TODO
 */
class LandViewModel : ViewModel() {

    val tempLiveData = MutableLiveData<Int>()

    var index = 0
    fun add() {
        tempLiveData.postValue(++index)
    }

    fun value() = let {
        tempLiveData.value.takeIf {
            it == null
        } ?: -1
    }
}